package com.example.demo.service;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @className: Test
 * @author: 芃
 * @description:
 * @date: 2025/1/21 9:51
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<String> target = new ArrayList<>();
        ArrayList<String> source = new ArrayList<>();
        while (scanner.hasNextLine()) {
            String str = scanner.nextLine();
            if (str.equals("exit")) {
                break;
            }
            source.add(str);
        }

        while (scanner.hasNextLine()) {
            String str = scanner.nextLine();
            if (str.equals("exit")) {
                break;
            }
            target.add(str);
        }

        for (int i = 0; i < target.size(); i++) {
            String str = target.get(i);
            if (source.contains(str)) {
                source.remove(str);
            }
        }
        for (int i = 0; i < source.size(); i++) {
            System.out.println(source.get(i));
        }
    }
}
